#include "RNG.h"

RNG::RNG()
{

}

RNG::~RNG()
{

}

CString RNG::Get_Rng(int len)
{
    unsigned char buf[128] = {0};
    CString rng = "";

    for(int i = 0;i < (len / 128);++i)
    {
        RAND_bytes(buf, 128);
        rng.append(CString(buf,128));
    }

    if(len % 128)
    {
        RAND_bytes(buf, len % 128);
        rng.append(CString(buf,len % 128));
    }
    rng = rng.toUpper();
    return rng;
}
